/*
* SMILParser
*
* Version 1.0
*
* Programmers: Jesse Louderback, Noah Pham, Chad Carpenter, and Marc Hindman
*/
package com.SmilDial;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;

public class LoadingScreenImageMenu extends Activity {
	Bundle SMIL_Bundle;

	//Introduce an delay
    private final int WAIT_TIME = 400;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.loading_screen);
		findViewById(R.id.mainSpinner1).setVisibility(View.VISIBLE);
		
		//Gets the bundle from last intent, TextMenu.java
        SMIL_Bundle = getIntent().getExtras();
        
		new Handler().postDelayed(new Runnable(){ 
			public void run() {
				
				//Simulating a long running task
		        try {
		        	Thread.sleep(400);
				} catch (InterruptedException e) {
					
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			  
			    // Create an Intent that will start the ProfileData-Activity.
		        Intent mainIntent = new Intent(LoadingScreenImageMenu.this, ImageMenu.class); 
		        mainIntent.putExtras(SMIL_Bundle);
		        LoadingScreenImageMenu.this.startActivity(mainIntent); 
		        LoadingScreenImageMenu.this.finish(); 
			}
		}, WAIT_TIME);
    }
}
